<template>
  <div>
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>商品管理</el-breadcrumb-item>
      <el-breadcrumb-item>商品分类</el-breadcrumb-item>
    </el-breadcrumb>
    <!-- 卡片 -->
    <el-card>
      <!-- 搜索添加 -->
      <div>
        <el-button type="primary">添加分类</el-button>
      </div>

      <!-- 分页视图区域 -->

    </el-card>

    

  </div>
</template>

<script>
export default {
  data() {
    return {
      //查询条件
      querInfo: {
        type:3,
        pagenum:1,
        pagesize:5
      },
      cateList: [],
      // 总数据条数
      total: 0

    }
  },
  created() {
   this.init()
  },
  methods: {
    init() {
      this.getCateList()
    },
    //获取分类列表
    async getCateList() {
     const {data:res} = await this.$http.get('categories', {params: this.querInfo})
     console.log(res);
     //前端初始化数据
     this.cateList = res.data.result
     this.total = res.data.total
    }
  },
}
</script>

<style lang="less" scoped>

</style>
